package com.dzl.userwx;

import com.dzl.base.controller.BaseController;
import com.dzl.userwx.pojo.query.WelfareUserWxIntegralQuery;
import com.dzl.userwx.pojo.vo.WelfareUserOrganizationVo;
import com.dzl.userwx.service.WelfareUserWxService;
import com.dzl.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author chenlong
 * @description: saas服务端组织架构相关
 * @since 12:41 2021/09/06
 */
@RestController
@RequestMapping("welfareUserOrganization")
public class WelfareUserOrganizationController extends BaseController {


    @Autowired
    private WelfareUserWxService welfareUserWxService;

    /**
     * 名称或电话号码精确查询
     * @date 2021/9/9 15:59
     * @author caobucao
     * @param query 查询条件
     * @return com.dzl.util.JsonResult<java.util.List<com.dzl.enterprise.pojo.vo.WelfareUserOrganizationVo>>
     */
    @GetMapping("/getUserOrganization")
    public JsonResult<List<WelfareUserOrganizationVo>> getUserOrganization(WelfareUserWxIntegralQuery query) {
        query.setEnterpriseId(getAdminInfo().getEnterpriseId());
        return JsonResult.success(welfareUserWxService.getOrganizationUser(query));
    }



}
